package org.example.web;

/**
 * 枚举了一些常用API操作码
 *
 */
public enum ResultCode implements IErrorCode {

    //用户中心1开始
    //授权中心2开始
    //房屋中心3开始
    //公用服务中心4开始
    //订单中心5开始
    //社交中心6开始
    SUCCESS(200, "操作成功"),

    FAILED(500, "操作失败"),

    SUCCESS_SAVE(2001, "保存成功"),
    LOGIN_SAVE(2002, "登录成功"),
    LOGOUT_SAVE(2003, "登出成功"),

    PASSWORD_ERROR(500, "账号或密码错误"),

    VALIDATE_FAILED(50001, "参数检验失败"),

    UNAUTHORIZED(50002, "暂未登录或token已经过期"),

    ROLE_EMPTY(50003, "用户角色为空"),

    ERROR_SERVER_INIT(50004, "服务初始化异常"),

    REFRESH_UNAUTHORIZED(50002, "刷新token已经过期"),
    LOGOFF_MULTI_RENT(50005, "该账号加入了多个组织"),

    /**
     * 用户中心
     */
    USER_CENTER_ERROR(1001, "用户中心操作失败"),

    USER_NOT_EXIST(1002, "用户不存在"),

    USER_NOT_DISABLED(1003, "用户账号已被禁用"),

    REQUIRED_PARAM_LOGIN_TYPE(1004, "loginType 参数必传"),
    REQUIRED_PARAM_ENCRYPTED_DATA(1004, "encryptedData 参数必传"),
    REQUIRED_PARAM_CODE(1004, "code 参数必传"),
    REQUIRED_PARAM_IV(1004, "iv 参数必传"),
    REQUIRED_PARAM_PHONE_NUMBER(1004, "phoneNumber 参数必传"),
    PHONE_NUMBER_IS_EXIST(1009, "该手机号已存在"),
    USERNAME_IS_EXIST(1010, "该用户名已存在"),
    MOBILE_IS_NOT_EXIST_OR_IS_FORBIDDEN(1011, "该手机号不存在或手机号已被禁用"),
    USER_BASE_UPDATE_FAILED(1012, "user base 更新失败"),
    USER_UPDATE_FAILED(1013, "user 更新失败"),
    IDENTITY_AUTH_FAILED(1014, "身份认证失败"),
    USER_NOT_EXIST_OR_IS_INVALID(1015, "用户不存在或用户已被禁用或删除"),
    ENABLE_USER_FAILED(1016, "启用用户账号失败"),
    MQ_MESSAGE_SAVE_FAILED(1017, "消息保存失败"),
    MQ_MESSAGE_STATUS_UPDATE_FAILED(1018, "消息状态更新失败"),

    APP_ID_NOT_EXIST_OR_IS_INVALID(1019, "appId不存在或已删除"),

    REQUIRED_PARAM_APP_ID(1004, "appId 参数必传"),

    MOBILE_FORBIDDEN(1020, "手机号已被禁用"),

    MOBILE_NOT_FOUND(1022, "手机号不存在"),

    USER_IS_FORBIDDEN_OR_IS_INVALID(1021, "用户已被禁用或删除"),

    REQUIRED_PARAM_WX_CODE(1004, "wxCode 参数必传"),

    WECHAT_INFO_UPDATE_FAILED(1022, "用户微信信息更新失败"),

    WECHAT_INFO_SAVE_FAILED(1023, "用户微信信息保存失败"),

    REQUIRED_PARAM_LOGIN_USERNAME_AND_PASSWORD(1004, "用户名密码方式登录，usernameAndPasswordReq 参数必传"),

    REQUIRED_PARAM_LOGIN_MOBILE_AND_CODE(1004, "手机号验证码方式登录，mobileAndCodeReq 参数必传"),

    REQUIRED_PARAM_LOGIN_WECHAT_AUTH(1004, "微信授权方式登录，weChatReq 参数必传"),

    REQUIRED_PARAM_LOGIN_APPLET_MOBILE_AND_CODE(1004, "小程序授权手机号验证码方式登录，appletMobileAndCodeReq 参数必传"),

    REQUIRED_PARAM_LOGIN_TOKEN(1004, "loginToken 参数必传"),

    REQUIRED_PARAM_LOGIN_WECHAT_APPLET(1004, "微信小程序方式登录，wechatAppletReq 参数必传"),

    OPENID_IS_NOT_EXISTS_OR_IS_INVALID(1024, "该账号未绑定微信或账号已失效"),

    WECHAT_APPLET_CODE_BEEN_USED(40163, "code been used"),

    WECHAT_APPLET_INVALID_CODE(40029, "invalid code"),

    BRAND_IS_EXIST(3009, "品牌已经存在"),

    AGENCY_IS_EXIST(3010, "该中介已经存在"),

    MANAGER_IS_EXIST(3011, "该管家已经存在"),

    MANAGER_NOT_EXIST(3012, "该管家不存在"),

    AGENCY_NOT_EXIST(3013, "该中介不存在"),

    STORE_NOT_EXIST(3014, "该中介不存在"),

    WX_LOGIN_ERROR(3015, "微信授权登录失败"),

    KEY_IS_EXIST(3016, "钥匙保管记录已存在"),

    KEY_IS_EMPTY(3017, "钥匙保管记录不存在"),

    KEY_STATUS_ERROR(3018, "钥匙保管状态错误"),

    KEY_EXIST(3019, "钥匙已存在"),

    PLEASE_ADD_KEY_CODE(3019, "请填写钥匙密码"),

    TOPIC_FAILED(3009, "帖子不存在"),
    TOPIC_MY(3010, "不可以给自己点赞"),

    COMMUNITY_IS_NOT_EXIST(3010, "社区信息不存在"),

    DOMAIN_IS_NOT_EXIST(3020, "业务域不存在"),

    CLIENT_ID_IS_NOT_EXIST(3021, "请求头clientId不存在"),

    DOMAIN_ACCOUNT_IS_NOT_EXIST(3022, "业务域账号不存在"),

    DOMAIN_CREATE_USERID_IS_NOT_EXIST(3023, "userId不存在"),

    DOMAIN_CREATE_TENANT_ID_IS_NOT_EXIST(3024, "租户id不能为空"),

    /**
     * 公用服务服务
     */
    BIZ_FAIL(4001, "上传服务失败"),

    FILE_FAIL(4002, "文件不能为空"),

    FILE_MAX_FAIL(4003, "文件大于10M"),

    FILE_TYPE_FAIL(4004, "图片格式错误"),

    KEY_FAIL(4005, "key不存在"),

    FORBIDDEN(403, "没有相关权限"),

    NO_PID(4094, "请确认父级单位!"),

    FILE_NOT_FOUND(4006, "文件不存在"),

    MSG_COUNT_FOUND(4007, "发送短信次数已超过限制"),

    SMS_TOO_MUCH(4008, "发送验证码频繁"),

    SMS_ERROR(4009, "获取验证码失败，服务器异常"),

    SMS_NOT_SEND(4010, "验证码未发送"),

    CODE_ERROR(4011, "验证码错误"),

    MSG_TEMPLATE_FOUND(4012, "短信模板错误"),

    CONTENT_SMS_ERROR(4013, "发送短信消息失败，服务器异常"),


    /**
     * 租售服务
     */
    NO_AGENTS(5001, "代理顾问不存在"),

    HOUSE_FAILED(5002, "房产信息存储操作失败"),

    ENTRUST_TYPE_FAILED(5003, "委托类型错误"),

    MANAGER_NOT_FOUND(5004, "该小区暂无管家信息"),

    HOUSE_RENT_FAILED(5005, "租房信息不存在"),

    HOUSE_SALE_FAILED(5006, "售房信息不存在"),

    UPDATE_TYPE_FAILED(5007, "更新类型错误"),

    UPDATE_BASIC_FAILED(5008, "更新基本信息错误"),

    UPDATE_INNER_FAILED(5008, "更新内部设施信息错误"),

    UPDATE_INNER_EMPTY(5009, "内部设施信息为空"),

    UPDATE_TAGS_FAILED(5010, "更新标签信息错误"),

    ENTRUST_MSG_EMPTY(5011, "委托信息不存在"),

    HOUSE_MSG_EMPTY(5012, "房产信息不存在"),

    ENTRUST_IS_NOT_END(5013, "该房屋委托未结束"),

    ENTRUST_STAUTS_END(5014, "委托已结束"),

    ENTRUST_IS_PULISH(5018, "委托已发布"),

    ENTRUST_STAUTS_FAILE(5015, "委托状态错误"),

    MANAGER_FAILE(5016, "查询管家信息错误"),

    MANAGER_SERVICE_FAILE(5017, "服务已存在"),

    MANAGER_SERVICE_EMPTY(5017, "服务信息不存在存在"),

    BUSINERSS_SERVICE_EMPTY(5018, "物业信息不存在"),

    WECHAT_QRCODE_ERROR(5019, "微信二维码生成异常"),

    ADMIN_ERROR(5020, "管理员不存在"),

    ADMIN_FAIL(5021, "该成员已经是其他合作伙伴的成员，请联系管理员"),

    SAVE_ADMIN_FAIL(5022, "必须选择管理员"),

    SAVE_ADMIN_ERROR(5023, "该小区已存在，请重新选择"),

    ENTRUST_MSG_PUBLISHED(5024, "委托信息已发布,请先下架再修改"),

    ENTRUST_MSG_FINISHED_OR_REJECT(5025, "委托房源信息已成交或已驳回,暂不支持修改"),

    HOUSING_RESOURCE_HAD_DOWN(5026, "该房源已下架"),

    THE_SAME_COMMUNITY_ADMIN_PHONE_NUMBER_REPEAT(5027, "当前小区管理员手机号重复"),

    THE_AMOUNT_IS_OUT_MAX_RANGE(5028, "金额超过限制范围"),



    /**
     * 社交服务
     */
    COMMENT_FAIL(6001, "获取评论失败"),

    COMMENT_ID_FAIL(6002, "评论入参不完整"),

    COMMENT_ID_ERROR(6003, "评论不存在"),

    NO_TAG(3001, "话题不存在"),

    FAILED_TAG(3002, "保存话题操作失败"),

    SAVE_FAIL_TAG(3003, "该话题已存在，保存失败"),

    QUERY_FAIL(3004, "未查询到话题，查询失败"),

    SAVE_FAIL(3000, "内容中含有敏感词汇，请修改后重新发布"),

    SAVE_FAILED_TAG(3005, "未获取到手机号，小区信息，创建发帖失败"),

    SAVE_MESSAGE_TAG(3006, "进行房屋认证后才能进行相关操作！"),

    CITY_FAILED(3007, "公共组件获取城市名失败"),

    CITY_CODE_FAILED(3008, "不是有效的城市编码"),

    GROUP_FAILED(3009, "创建小组失败，入参不完整"),

    GROUP_ERROR(3010, "小组信息不存在"),

    GROUP_TITLE_ERROR(3010, "小组名重复，请重新创建"),

    TOPIC_TITLE_ERROR(3011, "帖子不存在"),

    GROUP_DELETE_ERROR(3012, "小组已删除，请重新选择"),

    GROUP_JOIN_ERROR(3013, "该成员已加入该小组"),

    GROUP_JOIN_FAIL(3014, "不是该小区认证用户，不可以加入"),

    QUERY_GROUP_FAIL(3015, "未查询到小组信息，查询失败"),

    GROUP_FAIL(3016, "不允许设置成组长，未加入小组"),

    NO_GROUP_ERROR(3017, "已经是组长了"),

    ADMINISTRATOR_GROUP_ERROR(3018, "设定的管理员不能超过3个"),

    NO__GROUP_JOIN_ERROR(3019, "小组成员不存在"),

    NO__GROUP_TOP_ERROR(3020, "已经将帖子设置为精华"),

    RECOVERY_TOP_ERROR(3021, "闲置物品已被预定"),

    NO_GROUP_JOIN_ERROR(3022, "不允许执行该操作，不是组长"),

    NO_GROUP_COUNT_ERROR(3023, "没查到统计数据"),

    ORDER_ERROR(3024, "订单不存在"),

    NO_ORDER_ERROR(3025, "不允许删帖，该物品已被预定"),

    NO_BUY_ORDER_ERROR(3026, "不允许修改闲置物品，该物品已被预定"),

    NO_USER_ERROR(3027, "不允许修改闲置物品，无权限"),

    RECOVERY__ERROR(3028, "闲置物品已被删除"),

    DELETE__ERROR(3029, "不允许删除该贴"),

    CONTENT_ERROR(3030, "内容不允许为空"),

    PARAMETER_VALUE_ERROR(3031, "参数值错误"),

    RENT_ROOM_TYPE_EMPTY(3032, "房间类型为空"),

    ENTRUST_VISIT_FILE_CANNOT_EMPTY(3033, "带看图片不能为空"),

    PLEASE_DOWN_ENTRUST_HOUSE_FOR_UPDATE(3034, "请先下架委托房源再修改"),

    FAILED_TO_OBTAIN_INVITATION_CODE(20001, "获得邀请码失败"),

    INVALID_INVITATION_CODE(20002, "邀请码无效"),
    ACTIVITY_NOT_EXIST(20003, "活动不存在"),
    ACTIVITY_NOT_START(20004, "活动未开始"),
    ACTIVITY_END(20005, "活动已结束"),
    NOT_NEW_USER(20006,"当前用户不是新用户"),
    ALREADY_RECEIVED_THE_ACTIVITY(20007,"当前用户已领取过该活动"),
    ;

    private Integer code;
    private String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
